//Class Point is used to identify MyLocation of points
class Point
{
  float x;
  float y;
  Point()
  {
    set(0,0);
  }
   Point(float xp , float yp)
  {
    set(xp,yp);
  }
  void set (float xp , float yp)
  {
    x = xp;
    y = yp;
  }
}
//Class MyLocation is used to identify MyLocation of elements
class MyLocation
{
  float x1; //X coordinate of TopLeft
  float y1; //Y coordinate of TopLeft
  float x2; //X coordinate of BottomRight
  float y2; //Y coordinate of BottomRight
  Point point; //to store temp info
  MyLocation()
  {
    x1 = 0;
    x2 = 0;
    y1 = 0;
    y2 = 0;
   point= new Point(); 
  }
  MyLocation(float lx1,float ly1,float width,float height)
  {
    x1 = lx1;
    x2 = lx1+width;
    y1 = ly1;
    y2 = ly1+height;
    point= new Point();     
  }
  void setTopLeft( float lx,float ly)
  {
    x1 = lx;
    y1 = ly;
  }
  Point getTopLeft()
  {
    point.set(x1,y1);
    return point;
  }
  Point getTopRight()
  {
    point.set(x2,y1);
    return point;
  }
  Point getBottomLeft()
  {
    point.set(x1,y2);
    return point;
  }
  void setBottomRight( float lx,float ly)
  {
    x2 =lx;
    y2=ly;
  }
  Point getBottomRight()
  {
    point.set(x2,y2);
    return point;
  }
  float getWidth()
  {
    return x2-x1;
  }
  float getHeight()
  {
    return y2-y1;
  }
}

